public class BM1 {
    /*简单的整数二分 直接秒*/
    public int search (int[] nums, int target) {
        if(nums.length == 0){
            return -1;
        }
        // write code here
        int left = 0;int right = nums.length- 1;
        int mid = 0;
        while(left <= right){
            mid = left + (right - left) /2;
            if(nums[mid] == target){
                return mid;
            }else if(nums[mid] > target){
                right = mid - 1;
            }else{
                left = mid + 1;
            }

        }
        return -1;
    }
}
